package com.by.factory;

import com.by.strategy.LoginStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Fsw
 * @com.by.factory 登录策略工厂
 * @date 2025-08-25 11:48
 */
@Component
public class LoginStrategyFactory {
    @Autowired
    public Map<String, LoginStrategy> loginStrategyMap = new HashMap<>();

    /**
     * 根据用户登录类型获取具体的登录策略
     * @param loginType
     * @return
     */

    public LoginStrategy getInstance(String loginType){
        return loginStrategyMap.get(loginType);
    }
}
